<template>
    <div>
        <h2>用户注册</h2>
        <el-form :model="form" label-width="auto" style="max-width: 600px">
            <el-form-item label="姓名">
                <el-input v-model="form.name" />
            </el-form-item>
            <el-form-item label="昵称">
                <el-input v-model="form.nickName" />
            </el-form-item>
            <el-form-item label="部门">
                <el-input v-model="form.department" />
            </el-form-item>
            <el-form-item label="生日">
                <el-time-picker v-model="form.birthday" placeholder="Pick a time" style="width: 100%" />
            </el-form-item>
            <el-form-item label="性别">
                <el-select v-model="form.sex" placeholder="please select your zone">
                    <el-option label="男" value="1" />
                    <el-option label="女" value="2" />
                </el-select>
            </el-form-item>
            <el-form-item label="头像">
                <el-input v-model="form.avatar" />
            </el-form-item>
            <el-form-item label="登录账号">
                <el-input v-model="form.loginId" />
            </el-form-item>
            <el-form-item label="登录密码">
                <el-input v-model="form.password" />
            </el-form-item>
        </el-form>

        <el-button type="primary" @click="onSubmit">
            确定
        </el-button>
    </div>
</template>

<script lang="ts" setup>
import { getUser, addUser, getUserList, deleteUser, updateUser } from "@/apis/system";
import { reactive, ref, onMounted } from 'vue'
let form = ref({
    name: `admin`,
    nickName: '三儿',
    department: '1',
    birthday: '2024-01-01',
    sex: '1',
    avatar: '',
    loginId: 'admin',
    password: '123456',
})
const onSubmit = async () => {
    console.log('submit!')

    const res = await addUser(form.value)

    alert(res)


}
</script>

<style lang="scss" scoped></style>